﻿@model DateTime?
@if (Model.HasValue)
{ 
    @Html.TextBox(
        string.Empty,
            String.Format("{0:yyyy-MM-dd}", Model.Value.ToShortDateString()),
        new { @class = "datefield", type = "date" })
}
else
{ 
    @Html.TextBox(
        string.Empty, 
        String.Format("{0:yyyy-MM-dd}", DateTime.Now.ToShortDateString()),
        new { @class = "datefield", type = "date" })
}
